{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% block content %}
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'admin/css/widgets.css' %}"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >


<form method="get">
    {{ filter.form.as_p }}
    <p><b>Note</b>: Year format is YYYY-mm-dd</p>
    <button class="btn btn-primary btn-lg" type="submit">Search</button>

  </form>


<h1>Search Results: {{ filter.qs.count }}</h1>
<div class="panel panel-default">
    <table class="table">
        <tr>
                <th>Name</th>
                <th>Phone</th>
                <th>Experience</th>
                <th>Position Applied</th>
                <th>Registered On</th>
                <th>Vendor</th>
            </tr>
    {% for candidate in candidates %}
    <tr>
        <td><a href={% url 'Evaluator:candi_details' candidate.pk %}>{{ candidate.name }}</a></td>
        <td>{{ candidate.contact_primary }} </td>
        <td>{{ candidate.experience }} </td>
        <td>{{ candidate.position_applied }} </td>
        <td>{{ candidate.created_at }} </td>
        <td><a href={% url 'Evaluator:vendor_details' candidate.vendor.pk %}>{{ candidate.vendor }} </td>
    </tr>
    {% endfor %}
    </table>

</div>

{% if candidates.has_other_pages %}
  <ul class="pagination">
    {% if candidates.has_previous %}
      <li><a href="?page={{ candidates.previous_page_number }}">&laquo;</a></li>
    {% else %}
      <li class="disabled"><span>&laquo;</span></li>
    {% endif %}
    {% for i in candidates.paginator.page_range %}
      {% if candidates.number == i %}
        <li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
      {% else %}
        <li><a href="?page={{ i }}">{{ i }}</a></li>
      {% endif %}
    {% endfor %}
    {% if candidates.has_next %}
      <li><a href="?page={{ candidates.next_page_number }}">&raquo;</a></li>
    {% else %}
      <li class="disabled"><span>&raquo;</span></li>
    {% endif %}
  </ul>
{% endif %}

<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="{% static 'admin/js/core.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/admin/RelatedObjectLookups.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/actions.min.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/calendar.js' %}"></script>
<script type="text/javascript" src="{% static 'admin/js/admin/DateTimeShortcuts.js' %}"></script>

{% endblock %}
